﻿using Microsoft.Extensions.DependencyInjection;

namespace BlazorHelper;
/// <summary>
/// 依赖注入帮助类
/// </summary>
public static class InjectHelper
{
    /// <summary>
    /// 注入HttpHelper方法
    /// </summary>
    /// <param name="services"></param>
    /// <param name="http"></param>
    /// <returns></returns>
    public static IServiceCollection AddHttpClientHelper(this IServiceCollection services,HttpClient http)
    {
        services.AddSingleton(sp => http);
        services.AddSingleton(typeof(HttpHelper));
        return services;
    }

}